import React , { Component } from 'react';
import PropTypes from 'prop-types';

class TodoItem extends Component{
	constructor(props){
		super(props);
		this.handleDE = this.handleDE.bind(this);
	}
	render(){
		const { content, test } = this.props;
		return(
			<div onClick={this.handleDE}> {test}_{content} </div>
		)
	}
	handleDE(){
		const { deleClick, index } = this.props;
		deleClick(index);
	}
}

TodoItem.propTypes = {
	test: PropTypes.string.isRequired,
	content: PropTypes.string,
	deleClick: PropTypes.func,
	index: PropTypes.number
}
TodoItem.defaultProps = {
	test: 'helloworld'
}

export default TodoItem;